#include <rclcpp/rclcpp.hpp>
#include <geometry_msgs/msg/twist.hpp>


class VelCmdPub : public rclcpp::Node
{
public:
    VelCmdPub()
    : Node("vel_class_node")
    {
        vel_pub_ = create_publisher<geometry_msgs::msg::Twist>("/cmd_vel", 10);
        timer_ = create_wall_timer(
            std::chrono::milliseconds(1000),
            std::bind(&VelCmdPub::publishmessage, this)
        );
    }

private:
    geometry_msgs::msg::Twist vel_msg;
    rclcpp::Publisher<geometry_msgs::msg::Twist>::SharedPtr vel_pub_;
    rclcpp::TimerBase::SharedPtr timer_;

    void publishmessage()
    {
        vel_msg.linear.x = 0.1;
        vel_pub_->publish(vel_msg);
    }
};


int main(int argc, char* argv[])
{
    rclcpp::init(argc, argv);

    auto node = std::make_shared<VelCmdPub>();
    
    rclcpp::spin(node);
    rclcpp::shutdown();
    return 0;
}